import React from 'react';
import {connect} from 'dva';
import PropTypes from 'prop-types';
import {Table, Button,Row,Col,Layout, Breadcrumb,Menu,Dropdown,Popconfirm,Icon,Input,Card,Spin,Pagination,message,Tabs,Modal,Select,Form} from 'antd';
import style from '../../styles/TableCss.less';
import {Link} from 'dva/router'
// import Reset from '../../styles/ResetInput.less';
// import InStyle from '../../styles/Info.less'
// import reqwest from 'reqwest';
// import draftToMarkdown from 'draftjs-to-markdown';
// import draftToHtml from 'draftjs-to-html';
import {reqwest_get} from '../../utils/Reqwest.js'
// import {load_server} from '../../utils/Clue.js'
// import { Editor } from 'react-draft-wysiwyg'
const {  Content, Footer } = Layout;
const TabPane = Tabs.TabPane;
const ButtonGroup = Button.Group;
const Option = Select.Option;
class SalerDirector extends React.Component{
	constructor(props){
		super(props);
		this.state={
			tab:'1',
			data:[],
			loading:false,
			pagination:[],
			// columns:[{
   //      title:'客户名称',
   //      dataIndex:'name',
   //      width:'20%'
   //    },{
   //    	title:'手机',
   //    	dataIndex:'mobile'
   //    },{
   //      title:'面积',
   //      dataIndex:'size'
   //    },{
   //      title:'预约测量时间',
   //      dataIndex:'timer',
   //    },{
   //      title:'订单状态',
   //      dataIndex:'status',
   //    },{
   //      title:'金额',
   //      dataIndex:'money',
   //    },{
   //      title:'操作',
   //      key:'action',
   //      render:(text,record) => (
   //        <span>
            
   //          <Link onClick={()=>{window.sessionStorage['details']=JSON.stringify(text)}}  to={{pathname:'/app/deaor',query:{current:this.props.location.query.current,wudi:JSON.stringify(text),ma:'/app/newor'}}}>详情</Link>
   //        </span>
   //      )
   //    }],
		}
	}
	// fetch (params = {}) {
 //    console.log('params:', params);
 //    let _data=[];
 //    let _this=this;
 //    this.setState({ loading: true });
 //    reqwest_get('/api/orders',{
 //        access_token:localStorage['token'],
 //        page:params,
 //        pre:10
 //      },(data) => {
 //      console.log(data);
 //      const pagination = { ...this.state.pagination };
 //      pagination.total = data.total;
 //      // debugger
 //      for(let i of data.list){
 //        _data.push({
 //          key:i.id,
 //          ID:i.id,
 //          name:i.name,
 //          size:i.square,
 //          timer:i.booking_date,
 //          company_name:i.company_name,
 //          region:i.region_name,
 //          store:i.store_name,
 //          mobile:i.tel,
 //          address:i.address,
 //          status:i.workflow_state,
 //          money:i.total,
 //          remark:i.remark,
 //          province:i.province,
 //          city:i.city,
 //          area:i.area,
 //          street:i.street,
 //          strategy_result:i.strategy_result,
 //          description:<p>地址:&ensp;{i.province}&ensp;{i.city}&ensp;{i.area}&ensp;{i.street}&ensp;</p>
 //        })
 //      }
 //      this.setState({
 //        loading: false,
 //        data: _data,
 //        list:data.list,
 //        pagination:pagination.total,
 //      });
 //    })
 //    this.setState({loading:false});
 //  }
	componentWillMount(){

	}
	render(){
		const {loading,pagination,data,columns}=this.state;
		return(
			<Tabs onTabClick={this.props.onTabClick} defaultActiveKey="1" activeKey={this.props.tab} >
	      <TabPane tab="我的订单" key="1">
	        <Table columns={this.props.columns}
	          dataSource={this.props.data} 
	          id="table_clue"
	          rowKey="table_clue"
	          className="table_clue"
	          pagination={this.props.pagination}
	          loading={this.props.loading}
	          onChange={this.props.onChange}
	        />
	      </TabPane>
	      <TabPane tab="团队订单" key="2">
	        <Table columns={this.props.colu}
	          dataSource={this.props.data} 
	          loading={this.props.loading}
	          onChange={this.props.onChange}
	          pagination={this.props.pagination}
	        />
	      </TabPane>
	    </Tabs>
    )
	}
}
export default connect()(SalerDirector)